feat(appkit): agent chat UI primitives#366
Open
hubertzub-db wants to merge 1 commit into
Open
Conversation
7f2fddf to
ec42841
Compare
568a77a to
e2ded5a
Compare
hubertzub-db
commented
May 8, 2026
| "vaul": "1.1.2" | ||
| }, | ||
| "peerDependencies": { | ||
| "@ai-sdk/react": "~4.0.0-beta", |
Author
There was a problem hiding this comment.
note: we're importing canary channel since 4.0+ allows for customizing messages transport easily, should be published as stable very soon
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
e2ded5a to
c70492a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent chat UI primitives
Adds a small set of headless React building blocks for chatting with an AppKit
agents()server, and rewires the dev playground's agent route to use them.What's new
A new
@databricks/appkit-ui/react/chatsubpath exporting:<Conversation>— render-prop component that runs the whole chat (streaming, history, scroll-stick).<ChatInput>— render-prop input that handles Enter / Shift+Enter / IME / streaming-state.useChatanduseScrollToBottom— the underlying hooks for custom layouts.ResponsesApiTransport— the bit that talks to the agents plugin.The smallest working chat is now ~30 lines of JSX, and threads, tool calls, reasoning ("thinking…"), and destructive-tool approval prompts all stream through without any server-side glue.
Docs at
docs/docs/api/appkit-ui/chat/index.md.Why
Until now, anyone building a chat UI on top of the
agentsplugin had to hand-roll SSE parsing, message reducers, scroll behavior, thread-id plumbing, etc. — the dev playground's agent route was 500+ lines of exactly that. Now it's the same UI, but built out of reusable parts, and any consumer gets the same thing for free.We're piggy-backing on the Vercel AI SDK (
@ai-sdk/react,ai) for the reducer / state machine — they're declared as optional peer dependencies, so apps that don't use the chat primitives don't pull them in.Demo (playground still works)
Screen.Recording.2026-05-08.at.17.32.23.mov
Another demo (tool approval)
What changed in the playground
apps/dev-playground/client/src/routes/agent.route.tsxwas rewritten to use the new primitives. Behavior is the same (chat bubbles, tool approvals, autocomplete, event-stream debug panel), just driven by the shared components instead of inline SSE handling.Notes for reviewers
responses-api-transport.test.ts) and cover the wire-format translation end-to-end.